home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1998 September
/
Macworld (1998-09).dmg
/
Shareware World
/
Info
/
For Developers
/
MacZoop 1.8.3
/
More Classes
/
Threads
/
ZThreadedApplication.cpp
< prev
next >
Wrap
Text File
|
1997-12-24
|
1KB
|
63 lines
/*************************************************************************************************
*
*
* ObjectMacZapp -- a standard Mac OOP application template
*
*
*
* ZThreadedApplication.cpp -- the threaded application object
*
*
*
*
*
* © 1996, Graham Cox
*
*
*
*
*************************************************************************************************/
#include "ZThreadedApplication.h"
#include <Threads.h>
Boolean gMacHasThreadManager = FALSE;
void ZThreadedApplication::InitMacZoop( const short numMasterBlocks )
{
OSErr theErr;
long tmFeatures;
theErr = Gestalt(gestaltThreadMgrAttr, &tmFeatures);
gMacHasThreadManager = ((theErr == noErr) && (tmFeatures & 1));
// see if threads lib is linked on Powermac
#ifdef __powerc
if (gMacHasThreadManager)
gMacHasThreadManager = ( YieldToAnyThread != (void*) kUnresolvedCFragSymbolAddress );
#endif
ZApplication::InitMacZoop( numMasterBlocks );
}
void ZThreadedApplication::Process1Event()
{
ZApplication::Process1Event();
// if we have the thread manager, yield to any thread
if ( gMacHasThreadManager )
YieldToAnyThread();
}